win32/win64 fixes (compiles only without sql on my system)