Misc cleanup, comments and minor fixes