Fixed layer is null bug
Fixed layer is null bug (added unit tests and detected another bug)
Merge pull request #133 from JaumeFigueras/master

Fixed layer is null bug