Avoid bare asserts.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>