various fixes & cleanups