Ensure specified type is valid