Minor changes to avoid possible garbage data bugs