fix memset calls that had wrong order of args