Some fixes around and cleaning up