Fixed File Output Bug