Fixes #412

Fixing #412 and an issue with `security.context` having a _null_ token