Created by: simi
Fix for #9362 (closed) with test.
Updated fiddle with my changes.
http://jsfiddle.net/retro/sBt2A/