Send 'length' command line option as 'count' to API

fixed #251