Solves premature end of file error.