handle some edge cases and print warnings about invalid unit jsons