Fixed significant bugs, separate planning from working