Improve testing, catch exceptions