Financial market imperfection, overinvestment, and speculative precaution