Re-rolled patch #57, fixed custom command failed.
Attached interdiff for same.