Attempt to clean up file descriptors

http://goo.gl/slvDEg