Use isinstance instead of type() == x
Merge pull request #1486 from mdboom/unit/use-isinstance

Use isinstance instead of type() == x