Fix d function.
Add sman function.
Disable virtualenv prompt.
Check for invalid index in pyd.