minor bug fixes.
Merge pull request #1332 from ne0fhyk/master

Minor bug fixes