A few minor fixes and cleanups