minor fixes (whitespace and debug flag)
mkdir -p implementation