Fixed allowing terminal block insertions at the top of substacks

Fixes #241.

(Note that this still allows dropping a terminal block when the substack is empty, as that behavior makes sense).