AVALANCHE: Fix multiple bugs.