Fixed compile error and try to create if the .pm directory does not exist.