Fixing formatting and logic for admin pages