Added handling of NULL bricks.