Fix assertion code