Scottish Gaelic surnames do not have a space after Mac (or Nic), unlike Irish names. Historically they've sometimes been spelled with spaces, but nowadays the prescribed spelling is no space. An exception is if they contain the article an/a'. Please fix the following surnames, which in some cases will necessitate splitting Irish and Scottish forms:
Mac Alastair > MacAlastair
Mac Amhalghaidh > MacAmhalghaidh
Mac Aodha > MacAodha
Mac Aonghais > MacAonghais
Mac Càba > MacCàba
Mac Cailein > MacCailein
Mac Chruim > MacChruim
Mac Cionaodha > MacCionaodha
Mac Coinnich > MacCoinnich
Mac Coluim > MacColuim
Mac Cormaic > MacCormaic
Mac Dhòmhnaill > MacDhòmhnaill
Mac Dhubhghaill > MacDhubhghaill
Mac Dhubhshìth > MacDhubhshìth
Mac Ealair > MacEalair
Mac Eanruig > MacEanruig
Mac Eòghainn > MacEòghainn
Mac Fhionnlaigh > MacFhionnlaigh
Mac Gille Chrìosd > MacGilleghrìosd
Mac Gille Eòin > MacGilleeòin
Mac Gille Fhaolain > MacGillefhaolain
Mac Griogair > MacGriogair
Mac Iomhair > MacIomhair
Mac Leòid > MacLeòid
Mac Neachdainn > MacNeachdainn
Mac Nèill > MacNèill
Mac Pharlain > MacPharlain
Mac Ruaraidh > MacRuaraidh
Mac Tàmhais > MacTàmhais
Mac Thaidhg > MacThaidhg