Fixed various issues.