Added code to fix issue 45
Merge branch 'issue45'