Fixed various problems.