Add more input validation

Similarly for the quotes, the quotes field should be passed in as an empty array, even if it comes from somewhere else.