fixed several issues.