minor exception throw fix
Flat input fix
IO updates