Fix a small issue where the keepFrames are not being calculated correctl...

...y. As well, roll-back a MATLAB suggested change to replace 'find' in a function.