Clean up and minor fix