Fix tests and implementation of runtime:ports

Expected values changed, which revealed a bug