Add second argument to assert()

Fixes #3293 and #3570.