Fixed writing filter array/key bugs