Adding a ports variable
Fixing some compile warnings