Pab/devel 2

Fix for #104 - simply check in the top down phase that the required type matches none; if not, then fail.

Oh, and add tests.