Fix bug with sample end handling

- fix sampleStartLine handling
- add logging of sampling lines indices
- fix bug in isSampleEndReached(int)