Removing debug stuff.
Bug fix for histogram method. General tidying.