improve specs, work on error handling

This seems way simpler than the alternative, does this change cause any issues that you're aware of?