Some more small bug fixes