Fixing broken code