Added IFNDEF to AddOnTerminate

Added to detect definition in Simba, to prevent redefinition here.
For compatibility reasons.
Merge pull request #168 from idynin/master

Added IFNDEF to AddOnTerminate