Fixed some SQL queries
return proper role string