bug fixes for 1.x release, refactor, etc