fix validation errors in edge cases