Fixed URL encoding/decoding and reading frames (to fill a complete
buffer,
instead of only a part).