Multiple small bug fixes.