Implemented some tests and fixed #8