Correction of an issue with costmap and locking.