Added tests and backwards comptability from 0.6.1 commit by Ernie