minor bug fixes and improvements
fixed #12