Fix for ports >= 1<<15