Fixed issue #221, and other minor changes.
Merge pull request #226 from O1L/master

Fixed issue #221.