cleanup and a small fix