Issue #41: simplify first()

...and make it faster for empty inputs. See #41 for details.