fix bug in the c versions for smaller state sizes

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