Some small fixes to user api code.