Clean up solution and fix TypeScript errors