improved output of shares command and minor bug fixes