Added S-link support, fixed one fatal bug.