Improve lnum emulation