Use isinstance everywhere, don't check for old types