slightly improved type detection for a language that hardly has types