Bugfixes and generalizations^C