Fix closure bugs in Dygraphs