Locking version and a small bug fix