Added double check to authentication, fixed bug with test failing because of uninitialized arrays.