Fix for case-sensitivity in middleware/login after switching db-backends.