Fixes a crash during building placement.