added tests and minor bug fixes, 0.1.4