Patches for check_swap and check_tcp

Hello,
a minor fix for 'check_swap' plus a simple improvement for 'check_tcp'.
Please apply.