Remove some old code.
Remove unused variable.
Improve assertion messages.