Fixed functional and style issues.