bugfixes for previous patch