Fix a bug in the block drawing code