Updated tests and fixed #2.