Fixed encryption for KDB files
Minor fixeds on types
Added more error checking on field sizes in KDB files