Minor bug fix to subgoaling