Prefer instanceof over is_a

Change-Id: Icbdc54fcd655c80ad0eb68d114f93cfe41f9a827