Restore functionality after python decorator rewrite