Fixed persistance bugs
Code cleaning