Clean up and minor fixes