disable non-working scaling code; fix bugs in encoding