he talked to himself incessantly , whispering in his sleepwalking , shouting sometimes to the ghosts that haunted him , shouting often to the clockmaker or sometimes to god and seemed to confuse the two in his weakening mind .