Adding addkeys command and fixing a bug in newms