minor cleanups
fix bugs identified by chrisbee, also add more helpful output