Fixed invalid check in clean()