Also apply the fix to monster spawn function