Correcting warnings and Windows build errors