Setting timeout corrected
Uncommented error test
Corrected port range check