Fixed input/output issues