Clean up and fixes