Fixed a really egregious error in the analyser.

Turns out it was hardly analysing statements... Only assignment type.
Added a few tests to make sure that doesn't happen again.