Fixed python 3 stdin issue.