Encode undefined to lua nil