Phases, fixes #2 and #14