Fix case-insensitive dimension/keyword determination

The test-case was a bit broken though - it changed the case of the Hz
keyword which isn't clear from the documentation.  Better solution is to
preserve the case in the original input.