Fix stdin read.
Add pattern module.