Fixes issues that prevented passing test suite