Added type checks.