Well, as you probably know "del" is a contraction for "de el" and "al" for "a el" both of the examples you gave for both words are correct, the reason is that sometimes (like your examples) these words are completely optional, they don't add any meaning to the sentence, they just basically specify a bit more which is usually unnecessary