Fixed all the input kinds -- modulo bugs!

Thanks to pgasparo for doing most of the work