more cleanups

Signed-off-by: Jens Nyberg <jens.nyberg@gmail.com>
fixed possible bug

Signed-off-by: Jens Nyberg <jens.nyberg@gmail.com>