Fixed spark branching bug