Various modifications / bugfixes