I tried with igrik's "new style of replacing". It worked really well, the replacement on !?PI is fast and reliable. However, just recently I found that replacing a monster stack at !?PI is not possible. I tried all kinds of formats for the UN:O/UN:I commands, none of them works. The crashes at attempting to execute UN:I.
Is there any particular reason why monster stacks are different?
Edit: The best result of all for now is the format of wessonsm's recommendation
However, there is still "Map drawing error" showing at the start of the game, nothing more than that though. False alarm from HD?