Various small bug fixes, for QA round 2