Removing redundant int isinstance checks