Fix some issues on test for authentication