Fixed two bugs when setting up the environment when the caller is in a deployment file
Fixed two bugs when setting up the environment when the caller is in a deployment file

It is possible for __file__ to be a pyc file in some deployment situations
and it can be a full path (not sure how this slipped by).

amarandon/pinax,amarandon/pinax,amarandon/pinax,amarandon/pinax