BUG: improved fix for np 1.9 errors

See #3188.