Fixed code for new detector position.