Bug fix for returned results