Fix missing locals bug