Patch by Steven Shiau <steven@nchc.org.tw>. The only changes so far are: