Fix a bug on wall block calculation