BUG: Fix IndexError: too many indices with numpy 1.8