Fix issue that the service does not stop when shutdown.
Add test of remote port forwarding.