Fixes required to make all unittests pass.