Fixed some undefined variables and a bug where the admin was not created.