Fix some security issues