unit test updates & minor bug fixes