Fix bug with lua dispatching