Fix update logic

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>