Better error handling, more time statistics