Added version function, and fixed #3.