head function not properly pulling from last n members, n variable being reset on any value, n not being read properly by regex function
Fix n undefined or empty string for head function
Merge pull request #2 from zifu/master

Fixes to out of order messages, fixes to regex checking