#383 Fixed issues with local/global references
#383 Fixed failing auth tests.