Fix increment on error

Signed-off-by: Dima Kuznetsov <dkuznets@redhat.com>