fix bugs with duration and date inputs

Also remove debug button and function.