Fix crash when adding static objectives