Security bug fixes