Fixes for "--pools" flag and fatal JSON error

I made some changes that should resolve issues #38 and #39.