Fixes #4131: Security adjustments

It's a one-commit with minor adjustments (typo fix, unused import and removal of null-data check) of #4163