Refine validation message container searching logic. Fixes #364