Fix duration check for NaN
Fix svg element reference