Fixed escaping of class name
Fixed usage of deprecated method
Updated test for critical section
Updated critical section to create directory for its files