Fixed a bug with isinstance order