added a couple of new test case and fixed a bug in which flows got lost when "instanceof" was used.