Because I have a Kerr/Hanna marriage (1863), and that I looked at this family in detail a few years ago I thought I would share what I had. You need the original 1841, 1851 and Census, the transcripts don't show the fine details such as the lines used to define separate dwellings.
1841
James Ker (Clogger Master) 40
Janet Ker 55
Janet Hannah 3
---------------------------------------------
Jean Ker (Shopkeeper) 40
Agnes Ker 4
1851
James Kerr (Clogger Master) 54
Elizabeth Kerr Niece 25
Jessie Hannah Niece 18
-------------------------------
Janet Kerr (Grocer) 67
Agnes Kerr Niece 14
James Kerr must have died between 1851 and 1855 there is no death registration.
Jean Kerr the Shopkeeper is not in the 1851 Census, Janet is now there with Agnes helping out but I am not convinced Agnes is her niece.
Elizabeth appears on the scene, yet another niece, born in Kirkpatrick.
1858 Janet dies 23 JAN 1856 age 72 (granddaughter Jessie Hanna was the informant). She never married so it seems she had an illegitimate daughter along the way and maybe more than one. Her parents were recorded as Walter Kerr and Agnes Gibson.
Jessie Hannah disappears but oddly enough a death of a Janet Hannah occurs in Kirkpatrick on 19 DEC 1901, she was single and the informant was Robert Hannah, brother. I mention this because this is the same birthplace as Elizabeth. There is no death of a Jessie/Janet Hannah in Scotland that ties her to the Kerr family. She like her mother may have been illegitimate.
1861
Janet Kerr (Widow) 60
Agnes Kerr (Daughter) 28 or 38
---------------------------------
Elizabeth Kerr (unmarried) School Mistress 36
So now we only have Janet who I suspect is/was Jean back together with Agnes. There was only one Agnes born in Moffat. Janet died in 1874 her husband was William Kerr (the Baker) her parents were John Bell and Sophia Lowden/Cowden but I am having doubts other than carrying the same surname they were actually related.
Elizabeth is on her own. Elizabeth died 03 JUL 1865 daughter of John Kerr and Janet Proudfoot, Robert Kerr her brother was the informant. So I’ll assume John was a brother of James.
Hope this helps.
Don