Bug in extracting parent value, minor style changes