added some (de)mux tests, fixed implementations