MRG: Cleanup and a few minor improvements

Fixes #311