Minor bug fixes.

Signed-off-by: Natraj <natraj.iitb@gmail.com>