fixes #66, Grammar type detection detects the wrong grammar