Added functions to return Python tuples (error code, error string)