changes and bugfixes. Compiles on both 4.x and 5.x. PR: ports/57910 Submitted by: Marco Molteni <molter@tin.it> Committed on behalf of lioux@, who is having machine problems.