Added sorting for email and system users, fixed blank spots getting counted in the list, code cleanup