Some fixes for subdirectory support.