Fixes to bugs found by an anonymous contributor.