fixed a lot of functions (more VirtualProtect checks) + fixed various warnings