Slight refactoring & fix a type error

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Set default encoding mode to 8bit-clean

Signed-off-by: Anton Lofgren <alofgren@op5.com>