Added tests and fixed broken build