Pre-bug fix formatting.
Replaced an assertion with an error return.