fixing bugs, caused tests to fail

Signed-off-by: Alexander Book <redchrome@gmx.de>