Fixed some bugs and added auto locking on push.