Small fixes and cleanups