refactored tests and fixed #265 for my own gratification