German train attacker 'had psychological and drug problems'