Bug fixes for adding new commands.

Added default values and undefined checks.