Small changes to detector input and to padding function.