bug fix and memory usage reduction on PSA64