Fixes several issues mentioned in issue 1432.

Thanks, MarkL!

git-svn-id: http://corsix-th.googlecode.com/svn/trunk@2362 c39591fa-788f-11de-a72b-d90af8dea425