After much headache, I figured out that the problem with the blocks' opacity was that initGraphics was being called twice.