Fixed incorrect timeout setting for test and added error debugging code.