Misc fixes adding osx support.
Also fixed stack trace issue.
Added virtualenv support.