bug fixes and test updates