Bugfixes and further intermediate-layer functions.