Fix CSS and improve URL generation logic.