Login / permissions fixes.