Fixing bug found in testing