massive fixes all around