Minor bug on sprintf -> fprintf