Fixes bug with empty canvas