When investment habits affect optimal wealth growth