Some cleanup and minor tweaks