Python: Added ability to use None as id at exec_ method. C++: removed duplicated code from exec method body.