fix compare overflow

Signed-off-by: Mattias Andrée <maandree@operamail.com>
race condition

Signed-off-by: Mattias Andrée <maandree@operamail.com>
whitespace

Signed-off-by: Mattias Andrée <maandree@operamail.com>