Security bug fixes (still not done, but the worst ones are now gone)