Fix error closing walls

Fixed the error closing walls if the last wall was defined as advanced