First hand I'd probably again bet $9 on the river and consider folding to a large raise. Second hand check-fold.

One possible way of dealing with scare cards is to just bet anyways. You make it more expensive for your opponent to bluff, and also present the possibility that you may've actually been semi-bluffing and now have the flush or straight. As a result most opponents will be reluctant to raise you without actually having what is it they'd be representing. Checking when first to act just seems too weak in most situations, and basically invites a bluff. If you're in position and suspect you might get check-raised, just check behind, then call the river bet or bet when checked to.