Fix windows build and some minor fixes

Signed-off-by: Ivailo Spasov <ivailosp@abv.bg>