Fixes for port bugs.