Fixed both remaining bugs and more optimizations, thanks to Trilby.

Bars are now drawn on the correct monitor and not painted more than
once.