Race-case fixes and other minor improvements.