Fix for issue #322
Merge pull request #323 from lingalamadhukar/bugfixes

Fix for issue #322