Performed code analysis

Hello!
I really like and appreciate your fork and many improvements over original code base.
I included it into my project and noticed some Code Analysis warning (nothing of serious, btw) that I fixed by myself.

Hope appreciated,
V.