Coding style fixes

Also gets rid of some unnecessary function parameters.