Fixed bug in type of pos variable.

Also added quit with the 'q' key.