Fixed bugs

Obs: bug with memory leakage when running over longer time..