Make sure sessions are started before destroying them.

Fixes #3551
Fix Hash::get($data, '0')

Fixes #3555