Fixed file descriptors & references