Work properly with subdirs