Fixed indentation and missing parent checks