A few minor fixes and cleanup