formatting fixes and minor fixes due to tests