Fixed issue 104
Applied Stephen Lewis' patch.