Port fixes #5