Fixed merge of fox code

Stanalone code seems to give diferent error, neither work.