Fix two bugs with the Lua bit lib

Fixes #832
Merge pull request #45 from otland/master

Fix two bugs with the Lua bit lib