fixed open file handle issue with len calls
updated length test to be proper test instead of something that needs to be checked manually.
Merge pull request #117 from gpratt/master

Fix for leaky len call