Improve robusness
Cleanup
Fix for #890