Fix shadow detection