Added modifications suggested by Charles Smutz (https://redmine.openinfosecfoundation.org/issues/602)