Remove some debug stuff and adjust some lua calls