Case insensitive units parsing and comparison

Should fix the issue #2096 .