fix some bugs & add a recent-ip cache
Merge pull request #6 from stephen-soltesz/master

fix a few ptr bugs and add a recent-ip cache