clean up, bug fixes