Fix filename string and memory limiter bugs