#584 fixed issue with secureOnly=false

Resolves #584