Final cleanup and fixes