Fix for IE, at least IE 10. Issue 578