Fixes more function errors

Also adds __self__