Fix for bug#9418. (improved)

Hi,

I modernize the pull request has been sent previously.
All case which I have listed in bug#9418 will be fixed.

(ref.) https://github.com/OTRS/otrs/pull/67

Regards,
Norihiro