Fix wall detection bug