Extended test
Updated tests and fixed some bugs