Fixes problem with exceeding array limist in ReSample routines.
Merge pull request #5 from krilor/master

Fixes problem with exceeding array limits in ReSample routines.