Fixed a lot of small bugs and made load time more than a factor 10 smaller