cleanup and a fix