Addl unit tests, correct logical flag issues