Added new test and fixed a bug in analyser.

Bug: the return check on if wasn't correct when the if doesn't have an
else, now it correctly does the check.
Test: permutation, not completed yet.