avoid vstack of 0-length arrays; cast result as int