A fix for Issue #713 

Hi,

I tried to fix the issue #713 however I'm not a ruby developer and I don't really know how to test it properly. The goal is just to give you a hint to help you fix it.

I just hope it helps.