Removed unused imports, fixed some warnings and tried to speed
Levelprint up.

Signed-off-by: Thomas den Hollander <denhollander.thomas@gmail.com>