Added helpers and fixed tests