Fix problem with malformed URI (in firefox)