Merge pull request #160 from camilin87/master

merge last changes to my branch
fixes to leave functionality

fixes to leave functionality
Merge pull request #161 from camilin87/kmoya-dev-branch

merging my branch with master