Fixed filter bug; refactored filtering code; fixed column ambiguity bug