Error handling improved, etc