Fixed bug in isSimple