Fixed memory leak
Fixed potentially uninitialized local variable warning
Fixed missing void in function with no parameters
Merge pull request #115 from cforfang/small_fixes

Memory leak + small fixes