Fixes multiple death-related bugs