Added custom directory? method and added corresponding tests.