fix related aliasing and improve tests