Cleanup of last commit and also added more tests