A bit better support for subdirectories
Remove some broken subdirectory code