Fixed a case where lua returned an error and it was not detected