Fixed error in result processing