Fixes issue with RDP port selection

The RDP port selection is not properly being handled. This patch fixes the
issue.