Fixed possible bug.
Potential DoS fixed.