fix atoi check and consistency with braces

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