Improve security checks
Tidied up whitespace