Fixed compatibility with Canvas API