Performance + bugs fixed