Updated phase_contorller tests, added new ones, found some bugs