Deallocation errors fixed
Fixed uninitalized variable
Possible NULL pointer dereferencing fixed
Merge pull request #27 from BlueAndi/master

Some bugs fixed    / Thanks Andi!