Added type checking for print statement.