Just sit back and take a rest, just get off the sex thing for a while, also try getting of a more healthier diet, with more fibre in it, more fruit, even try just eating fruit for a whole day, and keep away from fast food and get some exercise, this will or maybe get your bowls back working again.
Try some things that are more natual for a stronger erectoin, google erection tea and the 5G's and look for pegym.
Good Luck
I do not think these problems are related. I've had hemroids before often times they will go away on their own, if they persist you may want to ask a doctor. As for the problem maintaining an erection this is often due to stress I've seen it happen in a couple of long term relationships with guys during stress related periods that they had issues with keeping an erection. However once those were resolved our sex life went back to normal. Since its only twice I wouldn't worry as worrying about this issue will only cause more stress only adding to the problem. If for some reason you continues I would suggest yohimbe bark or extract (which you can find at a local grocery or health store) its rather inexpensive, it takes about 30 minutes to kick in and enlarges the blood vessels making it easier to get an erection that is also harder and stronger to boot. Best of luck to you as I hoep this helps, Alex