Minor memory improvements