cleanup and fixes for #14