Updated lua code. Relates to #78.