Minor fixes and one step closer to not failing tests (they still fail, though)