Small cleanup and minor fixes