many fixes for lua port; update mapdb