Fixed result type determination mechanism--all test cases now pass