Utilities for lua2