added some fixes and improvements to the test