Fixed issue with creating layer documents