Use LCM of 1 when handling an empty set.

Wanted to add a test for this, but the tests seem to be scattered and I've found no clear way of running any of them.