fix some cleanup issues