Initial commit.
Improve error handling.