Fix f-common-parent if input list has just one element

I've run into this issue just now. It goes into infinite loop if the input list has just one element.

Somehow this possibility slipped my mind when I wrote this originally. But we should always think about the edge conditions, so here's the fix. I've also added a test so this is covered in the future.

Sorry for the noise :/