Misc fixes. Cleanup before submitting stable version.