Fix possible denial of service exploit