Fixed #261. Use strncmp instead of a comparing trick.