Fixed bug in shadow opt