Many small improvements and bug fixes.

Now it can distinguish between soft (empty lang) and hard (ERROR) failures.
Minor bug fixes. Better error message.