Some minor changes and cleanup