Added some param docs and inlined a few highly used functions.