Adds missing parameter.
Code refactoring. minor fix-ups.