Use reset($array), based on a suggestion by blueyed on http://stackoverflow.com/questions/1921421/. Fixes #6