Added extra assertion on the cause of the exception