Make Lua check_* functions return shared_ptr.