Fix case and tempfile reads