Fixed bug in ensureAdmin