Add check to prevent the return of a wrong value when key is NULL_KEY
Merge branch 'master' of /home/opensim/src/opensim