fix some startup errors in .profile

see http://unix.stackexchange.com/q/107369/29146 for
background on this problem.