Bug with the canvas boundary fixed with some unit tests.