Fix small bug in s/n support, and add test