Exit when last element

Fixes #14