Use bytes instead of str where appropriate