Add validations for empty/missing input.

Fix bug when editing beats per measure.
Ensure a single line for template metadata