misc. fixes and cleanups