fix calling convention and arg types