Fixing a bug with member function.