small bug fixes for last commit