Fixed some bugs.
Merge pull request #17 from MarcCote/fix_bugs

Fixed some bugs.