Input/Output remodeling and minor bugfixes