Fixed errors in pre-process