Some bigger fixes