Updated some lua functions