Fix problem where patch was executing privilege logic before username was set.