Fixed canvas's init functions not being called in Firefox