Cleanup and minor mods