add compile guards, removed redundant test cases