Fixed several issues.