fixed Windows compile errors and warnings