Minor cleanup and fixes