Add more unit tests for Base locking, refactoring.