API fixes (thanks to Guido Mocken)