Fixes for Issue [#178]

These are the changes I proposed for issue [#178].