Bunch of small sanity improvements and implementation of Lav_getParent.