Cleaned up type/value checks