This seems to be an issue in SVN r3195 an upper.
When playing as Warlock, and you build a Crypt and then Maze, you can no longer select Gargoyles from the Crypt. Clicking on the Crypt opens up the Maze instead.
This seems to happen because the click event is being resolved in the same loop that renders the buildings? From what I saw, the Maze has a higher priority as defined in CacheBuildings. This fix basically loops the building in reverse, the first time and resolves and click events. And then it loops once again for the other types of buildings. ....Perhaps not very effective but seems to solve the issues.