Fix py3 bug, only decode if it's a binary type