Fix slow down due to BasicBlock.instructions (#426)