Fixed compiler warning for possible data loss when using negative integers for return codes