Minor bug fixes I should have found earlier