Bugfixes to work with more data