Added bugfixes