Throw InvalidSchemeException when invalid schemes are set.
More strict type checks for schemes.