Several improvements

Better error handling, ‘diff’ command added.