fix several bugs with this port


git-svn-id: http://svn.midnightbsd.org/svn/mports@16366 c872e0db-cc11-e311-ab8b-002590791c19