Fixed performance problem and issue with reset