Re-adding some cleanup code I removed for debugging purposes.
Make the background of the canvas black so that resizing doesn't flicker as much