Resolving module build errors and code cleanup.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>