ENH: Restored implementation of AddCustomCommandToCreateObject. Updated it to use newer custom command functionality.