small bug fixes related to "self"