Fixed syntax error in _convert_val
basic cleaning