Fix for issue 14375

Error demo can be found on http://jsfiddle.net/d45cc0rs/
Fixed demo can be found on http://jsfiddle.net/7ga1mz6r/