Added some extra value checks.