Can excessive masturbation or low testosterone levels cause erection problem?

I had a poor erection during a massage session. Why?