Error handling and better char mapping.