fixed many small bugs

Signed-off-by: Sweil <mail@sweil.de>