Clean up and debug