Add type annotation to IO objects

This removes some ambiguity warnings