Replaced implementation of Lua method setParent(). Added helper method SetParent().