preprocessing fixes