Numerous bug fixes all across the board