Cleanup and fix test