Bug fixes caused by last commt