fix warnings
fix assertion
fix compilation with nvcc
use pointers to Ports instead of their names