Lots of lint changes, param fixes and cleanup of code