Added testcases for service.fds and service.fds.set

Also found bugs and fixed them.