bugfix attempt
Merge pull request #1224 from casadi/quickfix

#1223 Addition to pull-request