Fixed missing parameters.
Improved code.