Fixing segfault while adding a transition