Major changes from lint, not fully working yet...
Fixed many problems reported by lint.