Fix getNext and getPrevious function
Merge remote-tracking branch 'origin/master'