misc fix & add command
polish macro CMD_XX and shape API