minor fix: assertion would always throw error instead of warning