Fixed raw use of file functions.

Change-Id: Ie7d5a788592ac210ec135795d0939cdde15aab0d