Add a test and clean up patch.