Encoding and margins fix.