Number of links bug fixes and better tests