Use iterator().next() instead of Iterables.getOnlyElement()

Fixes #185.