Check post parent correctly on insertion

Fixes #228.