fix mapping to first and last record in cursor.
Merge pull request #370 from ikkez/cursor-fix

mapping to first and last record in cursor.