Fix bug with return type self in namespace