Fix for admin bar

Follow on from #688 to fix broken admin bar.