Fix function boundary-case

Prevent starts_and_ends_with_quotes from raising an exception by calling
`hd` on an empty list. Further, ensure at least one character could be
between the quotes.