Added tests and fixed a total crash
1.1.1