Fix bugs in eunit and pulse test cases