Some DOM/Canvas compatability fixes