consistently use id_of
better error messages in command line client