Fixed crash when setting Layer::shader to NULL