Workaround spawn bug and add two new functions