General code repairs