Fix some possible signedness problems

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Constify methods

Signed-off-by: Sven Strickroth <email@cs-ware.de>