Added convenience function to check type.