fixed some syntax issues with self, and json output