Bug fixes for filter2D and associated tests.
Merge pull request #2812 from arkunze:pullreq/140520-filter2D