Fixed a few bugs.
Merge pull request #2 from belisarius/master

Fixed a few bugs.