Removed usage of private API.
Fixed minor warning