More checks and balances on files and pointers.