EXACTLY!
He wanted to keep the peace in the ship and the crew, he wanted to help Anya but also help his "friend" without losing anyone
He had good intentions and a good heart, but took bad decisions and even worse actions