return 0 instead of assertion failure in certain conditions