Fixed bug; Now automatically validates the input tag before conversion.