Fixed RegisterScript and GetScriptIndex wrongly declared as returning an unsigned int when in fact they can return -1 and fix this wrong assumption in other places