Updating as per review comments.
- Fixed timeout to use microseconds
- Fixed bitmap to be zeroed out only upto nfds
- Fixed code styling issues