Cleaning and bug correction

Clean a added a couple of improvements on the get data function that
prevented to update a self variable.