some fixes & cleanups