cleanups and fixes