cleanup and test fixing