Fix for 1st bug

Fix for 1st bug
Merge pull request #74 from Georggi/patch-5

Fixes for some bugs