he had remained as cheerful as possible under the circumstances , but now , as he sat cleaning his fingernails with the long blade of his pocketknife in his study at home , a great gray wave of depression crashed over him .