Add: compat for Lua 501
Fix: a lot of compact bug