Fix part of bugs [ bug #766 ]

All blocks if ($res < 0) were reverse... if $res < 0 then Error else OK... This regression was here since 7 month...