Fix for issue153

Here is my take on fixing #153