SWIG: use printf instead of echo for error message
Use dict.pop() instead of if statement