Clean up and fix test