Cleanup and fixes from last few commits