Added wall detection.