Ported to new task state
Fixed a few things I hope