Some improvements (fixed mkdir error in certain cases, and added composer.json)