Improve security (issue #1825)