Fix some bugs.

This doesn't work anymore, so I made some changes to make it work, at least.
Merge pull request #5 from inetfuture/master

Fix some bugs.