Update remaining functions, fix bugs introduced in former commits.