Fix checking if upload is finished (bb#545)