Added range detection in TypedValue