Fixed clearing canvas with no width/height attributes.

Added tests.