clean up and a couple fixes