Fixed SEGFAULT in contour layer initialization