Fix Firefox bug in canvas9, canvas 10

All calls to functions must appear below the function.