I think I finally managed to fix this thing completely