Test Errors Returned by Syscalls

Also fixed bug where we were losing task ids when invalid priorities
were given.