Improve error handling.

Factorize code and produce more descriptive errors
Update version number
Update compiled files