Cleanup + fix in key IO code.
Cleanup + fix in key IO code.

neomonkeus/niflib,neomonkeus/niflib,figment/niflib,BlazesRus/niflib,figment/niflib,amorilia/niflib,figment/niflib,BlazesRus/niflib,niftools/niflib,neomonkeus/niflib,amorilia/niflib,niftools/niflib,niftools/niflib