Proper type checking/comparison using "isinstance"

Instead of weird literals.

Maybe you are trying to compare values and not types.