fixes for #27, #17, #14, misc cleanup for v0.3.0