More bug fixes. Encoding sadness