Fix custom memory handlers test