Hack to work around redraw issue, test tweaks
Improved implementation of begin_*()/end_*() drawing calls.