Fixed a bug in set method. Also started command line utility.