Fix read error handling, tweak difficulty calculation