A few bugs are fixed.
Some exceptions are added.