fix piston bugs, fix crashes, don't use bluescreens when compiled with debug mode in visual studio