cleanups and small fix