More small bug fixes