Fixes: #2721 using self outside of classes