fixed eploits.
Merge pull request #25 from bcoe/exploit-fix

Fixed two major exploits pointed out in #21