various bug fixes and updates