Fixes to make tests pass
merging conflicts