Created tests for IO class + some fixes