Runtime error fix.
Merge pull request #3412 from Segrain/master

Runtime error fix.