Fix for issue #166. Sorry for the delay.