Memo.scala bug fixes/testing code improvements