Added some null checking, made limit and dump directory command line
arguments.