Fixed error get html dir attribute.

Was throwing error when converting to lowercase with DIR values was not
present.