Cosmetic change: rewritten error conditions in a more compact way