Wrap more calls into assertions, resulting in a bugfix