Added tests and additional CLI fixes for #52