Fixed #86 and improved user role handling