bugfixes and upstream updates