additional tests and fixed bug