Fixed calls to instanceof