Fix command API

fixes #5013