Fixed #129: code is sanitized before throwing an error