bug fixes / clean up