Koji Arai pointed out that I screwed up the constants for folder open modes