Fix for #347
Revised fix for #347
Merge pull request #369 from hav3n/branch-fixes

Fix for #347