cleanup, and fixes