Fixes function setreturned errors