Fixed a null pointer exception from removeLock