Fixing bug in tests