Added handling of custom commands.