add minor security fixes and some tuning
merge