More balancing and bug fixing