fix a few bugs found during a test drive