Added self instance to many function calls, some indenting fixes