Merge pull request #1 from meiwin/master

Bugfixes and few additions
Merge remote-tracking branch 'upstream/master'