Updated the shadow offset calculation. Fix #194.