Valeant Pharmaceuticals swings to profit