Bugfix: correctly compute domain size