Fixed some security flaws