This fixes assert failures when running in debug mode. Signed-off-by: Martin Storsjö <martin@martin.st>