some small bug fixes