Adds some bugfixes