Fixed errors.

Missing self in a few places
Conform to coding conventions.