~ a lot of fixes

Signed-off-by: Vladimir Bulyga <xx@ccxx.cc>