Fixing some API mistakes