Consider the header with calculating the selected index. This fixes #55.