Fixed performance problems