fixes to existing code