Fix two bugs with the Lua bit lib

Fixes #832