Fix #119: Check if parent is nil