Fixes for real-world code