Refix bug with regression test