Merge pull request #3 from alexlib/master

Two bug fixes
fixed the bug in select region

the bug was introduced in the last set of changes, one for...end loop closed too early. fixed in the repository, sorry for the quick and dirty fix bypassing the pull request.
Merge pull request #2 from OpenPIV/master

merge the changes in the openpiv branch