Fixes and tests for validation