Fixed some security bugs.