API cleanup, minor fixes.