Fix API debugging issues mentioned in #283