more small bug fixes