Fixed some database queries because I'm scared they'd break life