Fixed 5.5 memory issue
Fixed typos in refactored code