Fixed status calculation bug