Changed do/end style block to brace style around #fopen calls.