In this code you should try updating lines 113 and 114 to be like this:
$retVal->errorCode = $tStat;
$retVal->errorMessage = $tErr;
I think this should clear up all these errors you are getting. Please make this update and make sure to upload the file and test it again. After you test please post back with the results, if this fixes these errors I will ensure that a bug is logged for this.