bug fixes and other changes