cleanup bug fixes