Fixing failing tests because of a nil.length statement