Added missing validation. Added provider checks.