Removed unused include and added missing close()-call.