Set secure flag on cookies
Minor improvements