For diagonal cliffs, orientation is respected during collision checking, but not when provided for the surface filter.
Even without filtering for ghosts to remove, the game does handle some ghost-collision and doesn't place them. Some. It's not perfect and ghosts can fully intersect cliffs. Will require implementing a basic collision detection algorithm to get past.
I fixed the part where it could kill real entities, but sometimes it still does or doesn't place things properly.