Added more tests and backwards compatibility