bug fixes and other stuff