Fix references and input type=date