Most humans today have mobile phones. According to the GSMA, there are almost 10 billion mobile connections in the world every day. These devices automatically capture behavioral data from human society and store it in databases around the world. However, data capture has several challenges to deal with, especially if it comes from old sources. Obsolete technologies such as 2G and 3G represent two-thirds of the total devices. To the best of our knowledge, all previous work only eliminates obvious problems in the data or use well-curated data. Eliminating traces in a time series can lead to deviations and biases in further analyses, especially when we are studying small areas or groups of peoples in the city. In this work, we present two algorithms to solve the problem of the Neighboring Network Hit (NNH) and calculate the distributions of trips and traveled distances with greater precision in small areas or groups of peoples. The problem of NNH arises when a mobile device connects to cellular sites other than those defined in the network design, which complicates the analysis of space-time mobility. We use cellular device data from three cities in Chile, obtained from the mobile phone operator and duly anonymized. We compare our results with the Government's Origin and Destination Surveys and use a novel method to generate synthetic data to which errors are added in a controlled manner to evaluate the performance of our solution. We conclude that our algorithms improve results compared to naive methods, increasing the accuracy in the count of trips and, mainly, in the distance distributions.