couple minor bug fixes
Merge remote-tracking branch 'upstream/master'
Merge pull request #268 from jkuk/master

couple minor bug  fixes