Minor changes.
Some bug-fixing and minor changes.