lua-factory: Add cast conversion