Fixing error in case of empty phases.