1 bug fix and 1 encoding fix