Fixing apparently never working code?