Fix crash with invalid input.
Add ambient color in case of geometry sampling, too.