fixes based on feedback from @shazow and @sigmavirus24
Add code to (hopefully) get to 100% coverage