Fix inotify handling