add direct tests for check_login
add more debugging output to check_login