Use WAITOK allocation, fix some arguments and remove a now unused