Refined error checking mechanism to reduce redundancy.