ifdefing and werror fixes