Fixed layer is null bug

Solves the #132