Made several good fixes to and because of the unit tests. Turns out the EC array...