Clean up and minor improvements