Fix parent null value in mask calculations, Fix azrafe7's #259