Fixed typo where an assertion error was not being thrown.

A minor fix that I noticed while looking over the code.