add inspect tool for lua; some fixes for lua scripts