Minor cleanup and api tweaks