Fixed manual appearance bans accepting a duration. Tidied up and improved a SQL query.