Fix missing check for allowEmpty