Minor fixes: validations, sorting